extends layout

block meta
    link(rel="stylesheet", href="#{options.cdn_path}/js/artDialog/skins/combo?/js/artDialog/skins/default.css&v=#{options.site_version}")

block content
    .navbar
        .navbar-inner
            a.brand(href="/")
                span.first #{options.site_name}
    .row-fluid
        .dialog
            .block
                p.block-heading 安装
                .block-body
                    form(action="/admin/install", method="post")
                        label 邮箱帐号：
                        input.span12(type="email", name="email", required="required", original-title="推荐使用网易或QQ邮箱！")
                        label 设置密码：
                        input.span12(type="password", name="pwd", required="required", original-title="请输入您的密码，6～24个字符！")
                        input.btn.btn-primary.pull-right(type="submit", value="安装")
                        .clearfix

block script
    script(src="#{options.cdn_path}/js/artDialog/jquery.artDialog.min.js?v=#{options.site_version}")
    script
        $(function(){
            $('form').submit(function(){
                var dialog = $.dialog();
                _post(this, dialog, function(data){
                    if(data.status) {
                        dialog.content('安装成功！').lock().time(1000);
                        setTimeout(function(){
                            location.href = "/sign_in";
                        }, 1000);
                    } else {
                        dialog.content('安装失败，请检查用户名和密码！').lock().time(2000);
                    }
                });
                return false;
            });
        })